package com.example.fashion.android.MultiMedia.activity;

import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.widget.LinearLayout;

import com.example.fashion.android.home.HomeActivity;
import com.example.fashion.android.R;
import com.example.fashion.android.base.BaseActivity.BaseActivity;
import com.example.fashion.android.util.LayoutUtil;
import com.example.fashion.android.util.NotifyUtil;

public class NotifyActivity extends BaseActivity implements LayoutUtil.ClickCallBack {
    //根布局
    LinearLayout mRootLayout;
    //通知工具类
    NotifyUtil mNotifyUtil;

    //普通的通知
    private static final int ORDINARY_NOTITY = 1 ;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mRootLayout = LayoutUtil.getLinearLayout(this, LinearLayout.VERTICAL, Gravity.CENTER);
        setContentView(mRootLayout);
    }


    @Override
    public void initView() {
        //显示标题栏
        setSystemTitleName("Notification(通知)");
    }

    @Override
    public void initData() {
        mNotifyUtil = NotifyUtil.getInstance(this);
        String[] notifyList = {"创建一个普通的通知"};
        //添加功能列表
        LayoutUtil.addFunctionList(this, mRootLayout, notifyList, this);

    }

    @Override
    protected void clear() {

    }

    /**
     * 功能的点击事件
     * @param tag
     */
    @Override
    public void onClickListener(int tag) {
        switch (tag) {
            case 0:     //创建一个普通的通知
                Intent homeIntent = new Intent(this, HomeActivity.class);
                homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, homeIntent, 0);
                mNotifyUtil.toastNotify(this,"普通的通知","进入主界面",System.currentTimeMillis(),R.mipmap.ic_launcher,R.drawable.logo11,pendingIntent,true,ORDINARY_NOTITY);
                break;
            default:
                break;
        }
    }

}
